<?
if (!defined('baseinfo')) {
    exitdata();
}   
?>

<script>

function changetabgame(tabset)
{
$('.gametab').hide();
$('.'+tabset).show();
$('.tgHdGen.tgCl.clBd2').removeClass('clSp2');
$('#set-'+tabset).addClass('clSp2');


}

function changetableadergame(tabset)
{
$('.wrpGpy').hide();
$('.classkey-'+tabset).show();
$('.btnGpy.clBd2.bdFull.fs05.clTxt2').removeClass('tgHdGpy');
$('#setleader-'+tabset).addClass('tgHdGpy');


}
var rownotipagegame=1;
function loaduserlistgame(page,param1,param2,param3)
{
loaddata();
$.get(serviceinfo+"getmygameactivity",{page:page},
function(data){
loadclosedata();
if(data.error.response)
{

alertbox(data.error.error);

}else
{
var code='';



if(data.data.recent.length)
{
$.each(data.data.recent, function(key, value) {

code += '<div class="rcntActList clBd2 bdBtm clearfix">\n';
code += '<div class="rcntActName">\n';
code += '<span class="clTxt2 fs04">'+value.msg+'</span>\n';
code += '<span class="clTxt3 fs02">'+value.ago+'</span>\n';
code += '</div>\n';
if(value.img!='')
{
code += '<div class="rcntActBadge">\n';
code += '<div class="actBadge">\n';
code += '<img alt="" src="'+value.img+'">\n';
code += '</div>\n';
code += '</div>\n';
}

code += '</div>';

});

}
if(page==1)
{
var param1,param2,param3;
setpaginationnoreverse('.pgActGame',data.data.rowpage,10,'loaduserlistgame',param1,param2,param3);
}

$('.wrpRcntActLst').html(code);


}
if(data.data.read.length)
{
var code ='';
$.each(data.data.read, function(key, value) {

code ='';
code += '<div  class="wrprNotiGame clBd2 bdFull clBg5 t104" id="rownotigamedata-'+rownotipagegame+'">\n';
code += '<div class="closeNotiGame" onclick="rownotigame('+rownotipagegame+')">\n';
code += '<span class="ico icoCloseNotiGame"></span>\n';
code += '</div>\n';
code += '<div class="wrpNotiGame">\n';
code += '<div class="congratGame">\n';
code += '<span class="clTxt2 fs04 boldGen">Congratulation!</span>\n';
code += '</div>\n';
code += '<div class="wrpBadgeNoti clearfix">\n';
if(value.img!='')
{
code += '<div class="badgeNoti">\n';
code += '<img alt="" src="'+value.img+'">\n';
code += '</div>\n';
}

code += '<div class="notiGame">\n';
code += '<span class="clTxt2 fs03">'+value.msg+'</span>\n';
code += '</div>\n';
code += '</div>\n';
code += '</div>\n';
code += '</div>';

$('.wrprGame').after(code);
rownotipagegame++;

});

$.each($('.wrprNotiGame'), function(index ) {

$(this).removeClass('t104');

});

}

});


}
function openbadgepopup(krowset)
{
$('#rowpopbadge-'+krowset).toggle();
}
function rownotigame(rownotipagegameset)
{

$('#rownotigamedata-'+rownotipagegameset).addClass('t104');

}
$( document ).ready(function() {
loaduserlistgame(1);

// Handler for .ready() called.
});
</script>


